function getHTTPObject(){
   if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
   else if (window.XMLHttpRequest) return new XMLHttpRequest();
   else {
      alert("Su navegador no soporta AJAX.");
      return null;
   }
}


function GetPage(pg,id_div){
    


            httpObject = getHTTPObject();
            if (httpObject != null) {
                httpObject.open("POST", "controlador/controlador.php", true);
                httpObject.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
                httpObject.send("pg="+pg);
                httpObject.onreadystatechange = function(){
                    if(httpObject.readyState == 4){
                        document.getElementById(id_div).innerHTML =httpObject.responseText;
                    }
                };
            }
      
   
}